<template>
    <div id="app2">
        <!-- 修改会员设置模板 -->
        <transition enter-active-class="animated fadeInDown" leave-active-class="animated fadeOutUp">
            <changeInit v-show="changeInitNum" @close="getInitNum"></changeInit>
        </transition>
        <!-- 查询游戏记录模板 -->
        <transition enter-active-class="animated fadeInDown" leave-active-class="animated fadeOutUp">
            <getGameLog  v-if="getGmaeInitNum"  @close="getGmaeInit"></getGameLog>
        </transition>
        <div id="videoTop" :class="{'attribute':Room_attribute}">
            <!-- 视频1 -->
            <div class="video" :style="Room_attribute?'overflow: initial':''">
                <!-- 倒计时 -->
                <div class="timeOut" v-show="init.Room.videoNotic==''">
                    <p class="dowmMoney">请下注</p>
                    <p class="timeShow" :style="{'color':djsTextColor}">{{Room.RestHops}}</p>
                </div>
                <div class="timeOut timeOut2" v-show="init.Room.videoNotic!=''">
                    <p class="dowmMoney">温馨提示</p>
                    <p class="timeShow">{{init.Room.videoNotic}}</p>
                </div>
                <!-- 广播 -->
                <div class="RedioBox"><p>{{Hall_Notice}}</p></div>
                    <!-- 视频 -->
                    <!-- H5 -->
                    <!-- <canvas class="videos" :style="Room_attribute?'height:154.6%':''" v-roomVideo="{id:1,src:'v1',c:vidoeObj1,login:videoLoginA}" width="500px" height="350px" ></canvas> -->
                    <!-- falsh -->
                    <object type="application/x-shockwave-flash" class="videos" :style="Room_attribute?'height:154.6%':''"  data="./static/falsh/LivePlayer2.swf" v-starFalsh="{set:setFalsh,index:'a'}" v-if="Videoshow">
                        <param name="menu" value="false">
                        <param name="scale" value="exactFit">
                        <param name="allowFullscreen" value="true">
                        <param name="allowScriptAccess" value="always">
                        <param name="bgcolor" value="#000000">
                        <param name="wmode" value="direct">
                    </object>
                    <!-- <div class="loginDV" v-show="init.Room.videoBox.a"></div>
                    <span v-show="init.Room.videoBox.a">加载中...</span> -->
                    <div class="loginDV" v-show="videoStatus[0]"></div>
                    <span v-show="videoStatus[0]">加载中...</span>
            </div>
            <!-- 中间信息 -->
            <div class="userCenter">
                <div class="logo">
                    <canvas class="rayBox" v-logo width="89px" height="88px"></canvas>
                </div>
                <div class="centerFath">
                    <div class="user userName">
                        <ul>
                            <li><span>用户名称：</span><span class="yellwo spanRight">{{Init.UId}}</span></li>
                            <li><span>账户余额：</span><span class="red spanRight">{{Init.UserCentent.Balance}}</span></li>
                        </ul>
                    </div>
                    <div class="user userGameDiv">
                        <ul>
                            <li><span>桌台编号：</span><span class="yellwo spanRight"><p class="roomName" >{{Room.RoomName}}</p></span></li>
                            <li><span>游戏局号：</span><span class="yellwo spanRight">{{Room.CurrJu}}/{{Room.CurrXue}}</span></li>
                            <li><span>房间限红：</span><span class="yellwo spanRight">{{Room.MoneyMax}}</span></li>
                            <li><span>个人限红：</span><span class="yellwo spanRight">{{XH}}</span></li>
                            <li><span>下注总额：</span><span class="yellwo spanRight">{{Room_zxh[Room_zxh.length-1]}}</span></li>
                            <li><span>在线人数：</span><span class="yellwo spanRight">{{ Room.PlayerNum>Room.OnlineNum||!Room.OnlineNum ? Room.PlayerNum : Room.OnlineNum}}</span></li>
                        </ul>
                    </div>
                    <div class="user userFooler">
                        <ul v-if="Room.GType==1">
                            <li><span>庄：</span><span class="propro"><span :style="{'width':Room_zxhPropro[0]}" style="background:#FF2222">.</span></span><span class="yellwo spanRight">{{Room_zxh[0][0]}}/{{Room_zxh[0][1]}}</span></li>
                            <li><span>闲：</span><span class="propro"><span :style="{'width':Room_zxhPropro[1]}" style="background:#00AEFF">.</span></span><span class="yellwo spanRight">{{Room_zxh[1][0]}}/{{Room_zxh[1][1]}}</span></li>
                            <li><span>和：</span><span class="propro"><span :style="{'width':Room_zxhPropro[2]}" style="background:#45E453">.</span></span><span class="yellwo spanRight">{{Room_zxh[2][0]}}/{{Room_zxh[2][1]}}</span></li>
                            <li><span>庄对：</span><span class="propro"><span :style="{'width':Room_zxhPropro[3]}" style="background:#FF2222">.</span></span><span class="yellwo spanRight">{{Room_zxh[3][0]}}/{{Room_zxh[3][1]}}</span></li>
                            <li><span>闲对：</span><span class="propro"><span :style="{'width':Room_zxhPropro[4]}" style="background:#00AEFF">.</span></span><span class="yellwo spanRight">{{Room_zxh[4][0]}}/{{Room_zxh[4][1]}}</span></li>
                        </ul>
                        <ul v-if="Room.GType==2">
                            <li><span>龙：</span><span class="propro"><span :style="{'width':Room_zxhPropro[0]}" style="background:#FF2222">.</span></span><span class="yellwo spanRight">{{Room_zxh[0][0]}}/{{Room_zxh[0][1]}}</span></li>
                            <li><span>虎：</span><span class="propro"><span :style="{'width':Room_zxhPropro[1]}" style="background:#00AEFF">.</span></span><span class="yellwo spanRight">{{Room_zxh[1][0]}}/{{Room_zxh[1][1]}}</span></li>
                            <li><span>和：</span><span class="propro"><span :style="{'width':Room_zxhPropro[2]}" style="background:#45E453">.</span></span><span class="yellwo spanRight">{{Room_zxh[2][0]}}/{{Room_zxh[2][1]}}</span></li>
                        </ul>
                    </div>						
                </div>
            </div>
            <!-- 视频2 -->
            <div class="video" v-if="Room.VideoUrl[1]">
                <ul >
                    <li @click="tabVideoTo(2)">本台全景</li>
                    <li @click="tabVideoTo(0)">大厅全景</li>
                    <li @click="tabVideoTo(1)">洗牌卓</li>
                </ul>
                    <!-- 视频 -->
                    <!-- H5 -->
                    <!-- <canvas class="videos" v-roomVideo="{id:2,src:'v2',c:vidoeObj2,login:videoLoginB}" width="500px" height="350px" ></canvas> -->
                    <!-- FALSH -->
                    <object type="application/x-shockwave-flash" class="videos" data="./static/falsh/LivePlayer2.swf" v-starFalsh="{set:setFalsh,index:'b'}" v-if="Videoshow">
                        <param name="menu" value="false">
                        <param name="scale" value="exactFit">
                        <param name="allowFullscreen" value="true">
                        <param name="allowScriptAccess" value="always">
                        <param name="bgcolor" value="#000000">
                        <param name="wmode" value="direct">
                    </object>
                    <div class="loginDV" v-show="videoStatus[1]"></div>
                    <span v-show="videoStatus[1]">加载中...</span>
                    <!-- FLASH启用 -->
                    <!-- <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="100%" HEIGHT="100%" id="myMovieName">
                        <PARAM NAME=movie VALUE="rtmp://live.hkstv.hk.lxdns.com/live/hks">
                        <PARAM NAME=quality VALUE=high>
                        <PARAM NAME=bgcolor VALUE=#FFFFFF>
                        <EMBED src="rtmp://live.hkstv.hk.lxdns.com/live/hks" quality=high  WIDTH="100%" HEIGHT="100%" NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
                        </EMBED>
                    </OBJECT> -->
            </div>
        </div>

        <!-- 下注区 -->
        <div id="GameBuy" :style="Room_attribute?'background:none':''">
            <!-- 左边选择 -->
            <ul class="leftButtn">
                <a href="./dirHtml/gameRule.html" target="_black"><li class="GmaeMess">
                    <div></div><p>游戏规则</p>
                </li></a>
                <li class="GmaeLog" @click="getGmaeInit">
                    <div></div><p>游戏记录</p>
                </li>
                <li class="GmaeInit" @click="getInitNum">
                    <div></div><p>账户设置</p>
                </li>
                <li class="back" @click="RetrunHall">
                    <div></div><p>返回大厅</p>
                </li>
            </ul>
            <!-- 下边选择 -->
            <ul class="floorButtn">
                <li class="fullScreen" @click="F11"><span>全屏</span></li>
                <li class="sound" ><span class="Music"><input type="range" max="100"  min="0" value="80" @change="setAudio($event)" ></span></li>
                <li class="refreash" @click="allVideoRestar"><span>重连视频</span></li>
            </ul>
            <!-- 下注确定取消按钮 -->
            <ul class="downMu">
                <li :class="{'not':downLiClass}" @click="notMoney">取消</li>
                <li :class="{'not':downLiClass}" @click="postMoneyFrom">确定</li>
                <li :class="{'yellow':allClass}"  @click="allMoney($event.target)">全押</li>
            </ul>
            <!-- 投注总金额 -->
            <div class="allMoney">
                <p>{{allDownMoney}}</p>
            </div>
            <!-- 桌号 -->
            <div class="numBer">
                <p>{{Init.GTableId}}</p>
            </div>
            <!-- 设置筹码 -->
            <div class="MoneyBox" @click="MoneyTableShow=!MoneyTableShow">
                <p>设置<br>筹码</p>
            </div>
            <!-- 筹码设置选择列表 -->
            <transition enter-active-class="animated slideInRight" leave-active-class="animated slideOutRight">
                <div class="MoneyTbale" v-show="MoneyTableShow">
                    <p>请选择最常用的5个筹码</p>
                    <!-- 筹码表 -->
                    <div class="table">
                        <ul>
                            <li :class="M.to?'OK':'default'" v-for="(M,k) in MoneyTable" :style="'background:url(./static/img/'+M.id+'.png);background-size:100% 100%'" @click="pushMoney(M.id)" :key=k></li>
                        </ul>    				
                    </div>
                    <!-- 确定取消 -->
                    <div class="post">
                        <ul>
                            <li class="okCm" @click="postMoney"></li>
                            <li class="notCm" @click="backMoney"></li>
                        </ul>
                    </div>
                </div>
            </transition>
            <!-- 筹码选择 -->
            <div class="MoneyRadio">
                <ul>
                    <li :class="cc==thisMoney?'OK':'default'" v-for="(cc,idx)in cm" :key=idx :style="'background-image:url(./static/img/'+cc+'.png);background-size:100% 100%;'"  @click=changeThisMoney(cc)></li>
                </ul>
            </div>
            <!-- 桌台下注区 -->
            <div class="GameCenterBox">
                <div :class="GTypeClass"></div>
                <!-- 百家乐下注区 -->
                <li class="Pair" :class="{'notDown':downNot}" @click="StarMoney(4)" v-if="Room.GType==1">
                    <div class="RultPz" v-show="cardResult.xh"></div>
                    <!-- 筹码 -->
                    <transition name="cm">
                        <div class="DownCm"  v-show="downMoney[4].laodMoney>0" :class="{'downCmAnimated':postAnimated}">{{downMoney[4].laodMoney}}</div>	
                    </transition>
                    <!-- 确定下注筹码效果 -->
                    <div class="postSuccenMoney" v-show="downMoney[4].downMoney>0">{{downMoney[4].downMoney}}</div>
                </li>
                <li class="Bpair" :class="{'notDown':downNot}" @click="StarMoney(3)" v-if="Room.GType==1" >
                    <div class="RultPz" v-show="cardResult.zh"></div>
                    <!-- 筹码 -->
                    <transition name="cm">
                        <div class="DownCm" :class="{'downCmAnimated':postAnimated}" v-show="downMoney[3].laodMoney>0">{{downMoney[3].laodMoney}}</div>
                    </transition>
                    <!-- 确定下注筹码效果 -->
                    <div class="postSuccenMoney" v-show="downMoney[3].downMoney>0">{{downMoney[3].downMoney}}</div>
                </li>
                <li class="Tie" :class="{'notDown':downNot}" @click="StarMoney(2)" v-if="Room.GType==1" >
                    <div class="RultPz" v-show="cardResult.h"></div>
                    <!-- 筹码 -->
                    <transition name="cm">
                        <div class="DownCm" :class="{'downCmAnimated':postAnimated}" v-show="downMoney[2].laodMoney>0">{{downMoney[2].laodMoney}}</div>
                    </transition>
                    <!-- 确定下注筹码效果 -->
                    <div class="postSuccenMoney" v-show="downMoney[2].downMoney>0">{{downMoney[2].downMoney}}</div>
                </li>
                <li class="Banker" :class="{'notDown':downNot}" @click="StarMoney(0)" v-if="Room.GType==1"  >
                    <div class="RultPz" v-show="cardResult.z"></div>
                    <!-- 筹码 -->
                    <transition name="cm">
                        <div class="DownCm" :class="{'downCmAnimated':postAnimated}" v-show="downMoney[0].laodMoney>0">{{downMoney[0].laodMoney}}</div>
                    </transition>
                    <!-- 确定下注筹码效果 -->
                    <div class="postSuccenMoney" v-show="downMoney[0].downMoney>0">{{downMoney[0].downMoney}}</div>	
                </li>
                <li class="Player" :class="{'notDown':downNot}" @click="StarMoney(1)" v-if="Room.GType==1" >
                    <div class="RultPz" v-show="cardResult.x"></div>
                    <!-- 筹码 -->
                    <transition name="cm">
                        <div class="DownCm" :class="{'downCmAnimated':postAnimated}" v-show="downMoney[1].laodMoney>0">{{downMoney[1].laodMoney}}</div>
                    </transition>
                    <!-- 确定下注筹码效果 -->
                    <div class="postSuccenMoney" v-show="downMoney[1].downMoney>0">{{downMoney[1].downMoney}}</div>
                </li>
    
                <!-- 龙虎下注区 -->
                <!-- 和 -->
                <li class="lh_he" :class="{'notDown':downNot}" @click="StarMoney(7)" v-if="Room.GType==2">
                    <div class="RultPz" v-show="cardResult.h"></div>
                    <!-- 筹码 -->
                    <transition name="cm">
                        <div class="DownCm" :class="{'downCmAnimated':postAnimated}" v-show="downMoney[7].laodMoney>0">{{downMoney[7].laodMoney}}</div>
                    </transition>
                    <!-- 确定下注筹码效果 -->
                    <div class="postSuccenMoney" v-show="downMoney[7].downMoney>0">{{downMoney[7].downMoney}}</div>
                </li>
                <!-- 龙 -->
                <li class="lh_l" :class="{'notDown':downNot}" @click="StarMoney(5)" v-if="Room.GType==2">
                    <div class="RultPz" v-show="cardResult.z"></div>
                    <!-- 筹码 -->
                    <transition name="cm">
                        <div class="DownCm" :class="{'downCmAnimated':postAnimated}" v-show="downMoney[5].laodMoney>0">{{downMoney[5].laodMoney}}</div>
                    </transition>
                    <!-- 确定下注筹码效果 -->
                    <div class="postSuccenMoney" v-show="downMoney[5].downMoney>0">{{downMoney[5].downMoney}}</div>
                </li>
                <!-- 虎 -->
                <li class="lh_hu" :class="{'notDown':downNot}" @click="StarMoney(6)" v-if="Room.GType==2">
                    <div class="RultPz" v-show="cardResult.x"></div>
                    <!-- 筹码 -->
                    <transition name="cm">
                        <div class="DownCm" :class="{'downCmAnimated':postAnimated}" v-show="downMoney[6].laodMoney>0">{{downMoney[6].laodMoney}}</div>
                    </transition>
                    <!-- 确定下注筹码效果 -->
                    <div class="postSuccenMoney" v-show="downMoney[6].downMoney>0">{{downMoney[6].downMoney}}</div>
                </li>
                <!-- 头像显示区域 -->
                    <!-- 1号 -->
                    <div class="txBox Num1" v-if="posiNumber==1">
                        <div class="img"></div>
                        <p>{{Init.UId}}</p>
                    </div>
                    <!-- 2号 -->
                    <div class="txBox Num2" v-if="posiNumber==2">
                            <div class="img"></div>
                            <p>{{Init.UId}}</p>
                    </div>
                    <!-- 3号 -->
                    <div class="txBox Num3" v-if="posiNumber==3">
                            <div class="img"></div>
                            <p>{{Init.UId}}</p>
                    </div>
                    <!-- 4号 -->
                    <div class="txBox Num4" v-if="posiNumber==4">
                            <div class="img"></div>
                            <p>{{Init.UId}}</p>
                    </div>
                    <!-- 5号 -->
                    <div class="txBox Num5" v-if="posiNumber==5">
                            <div class="img"></div>
                            <p>{{Init.UId}}</p>
                    </div>
                    <!-- 6号 -->
                    <div class="txBox Num6" v-if="posiNumber==6">
                            <div class="img"></div>
                            <p>{{Init.UId}}</p>
                    </div>
                    <!-- 7号 -->
                    <div class="txBox Num7" v-if="posiNumber==7">
                            <div class="img"></div>
                            <p>{{Init.UId}}</p>
                    </div>
            </div>
        </div>

        <!-- 聊天内容区 -->
        <div id="srokerBox">
            <!-- 开牌区 -->
            <transition enter-active-class="animated bounceIn" leave-active-class="animated fadeOut">
                    <div class="opneCard" v-show="cardResult.titel">
                            <!-- 文字 -->
                            <div class="CardTop" v-if="Room.BetMode==1">
                                <p><span :class="{'divX':Room.GType==1,'divX2':Room.GType==2}">{{cards.x}}</span></p>
                                <p class="pCneter">{{cardResult.titel}}</p>
                                <p class="pRight"><span :class="{'divZ':Room.GType==1,'divZ2':Room.GType==2}">{{cards.z}}</span></p>
                            </div>
                            <!-- 牌 -->
                            <div class="CardCenter" v-if="Room.BetMode==1">
                                <!-- 左边牌 -->
                                <div class="left">
                                    <!-- <div class="CardBox" v-for="cardd in cards.card.right.cardCenter" :class="'card'+cardd"></div> -->
                                    <img v-if="cards.xp[0]" :src="'./static/img/card/'+cards.xp[0]+'.png'" alt="" class='cardDt' >
                                    <img v-if="cards.xp[1]" :src="'./static/img/card/'+cards.xp[1]+'.png'" alt="">
                                    <img v-if="cards.xp[2]" :src="'./static/img/card/'+cards.xp[2]+'.png'" alt="">
                                </div>
                                <!-- 右边牌 -->
                                <div class="right">
                                    <!-- <div class="CardBox" v-for="cardd in cards.card.right.cardCenter" :class="'card'+cardd"></div> -->
                                    <img v-if="cards.zp[0]" :src="'./static/img/card/'+cards.zp[0]+'.png'" alt="">
                                    <img v-if="cards.zp[1]" :src="'./static/img/card/'+cards.zp[1]+'.png'" alt="">
                                    <img v-if="cards.zp[2]" :src="'./static/img/card/'+cards.zp[2]+'.png'"  alt=""  class='cardDt'>
                                </div>
                            </div>
                            <div class="TreeAndOne"  v-if="Room.BetMode==2">
                                <div class="isZ" v-show="Room.G_Result>=100&&Room.G_Result<200" >
                                    {{cardResult.titel}}
                                </div>
                                <div class="isX" v-show="Room.G_Result>=200&&Room.G_Result<300">
                                    {{cardResult.titel}}
                                </div>
                                <div class="isH" v-show="Room.G_Result>=300">
                                    {{cardResult.titel}}
                                </div>
                            </div>
                    </div>		
            </transition>
            <!-- 大路单标去 -->
            <Luand ref="luandSon" class="canvas" :model.sync="ludan" @postMessage="postMessage" @setLwz="setLwz" @setLwx="setLwx" ></Luand>
            <div class="UlButton">
                <ul >
                    <li style="color: #d40a20"><p>{{Room.GType==1?'庄':'龙'}}</p> 	<p>{{gameNumRults[0]}}</p></li>
                    <li style="color: #143ad9"><p>{{Room.GType==1?'闲':'虎'}}</p> 	<p>{{gameNumRults[1]}}</p></li>
                    <li style="color: #3bc940"><p>和</p> 	<p>{{gameNumRults[2]}}</p></li>
                    <li style="color: #d40a20" ><p v-if="Room.GType==1">庄对</p> <p v-if="Room.GType==1">{{gameNumRults[3]}}</p></li>
                    <li  style="color: #143ad9" ><p v-if="Room.GType==1">闲对</p> <p v-if="Room.GType==1">{{gameNumRults[4]}}</p></li>
                    <li><p>总数</p> <p>{{gameNumRults[5]}}</p></li>
                    <div class="divBox" style="color: #d40a20" @click="tabPostLudan(0)"><span v-if="Room.GType==1">庄问路</span><span v-if="Room.GType==2">龙问路</span>
                        <div class="htmlBox" v-html="lwzInput">
                                                        
                        </div>
                    </div>
                    <div class="divBox" style="color: #143ad9" @click="tabPostLudan(1)"><span v-if="Room.GType==1">闲问路</span><span v-if="Room.GType==2">虎问路</span>
                        <div class="htmlBox" v-html="lwxInput">
                            
                        </div>
                    </div>
                </ul>
            </div>
            <!-- 小路单 -->
            <transition enter-active-class="animated fadeIn" >
                <div class="Small" v-show="sallShow">
                    <div class="show" v-samll-Ludan="sallData.divWdith"  v-html="sallData.html"></div>
                </div>	
            </transition>
            <!-- 互动聊天	  -->
            <div id="chat" v-if="Room_attribute">
                    <chat :Room.sync="Room"></chat>
            </div>
            <!-- 普通房间列表 -->
            <div class="Room" id="Room" v-if="!Room_attribute">
                <div class="RoomTop">
                    <p :class="k==num?'in':''" v-for="(tiem,k) in sonRoom" :key=k @click="tabRoomTable(k)">{{k}}</p>
                </div>
                <div class="center" >
                    <div class="table" id="table">
                        <li v-for="(sonTemi,idx) in sonRoom[num]" :key=idx @click="TabRoom(sonTemi.GType,sonTemi.TId)">
                            <p class="left" @mouseover="sallData.data=sonTemi.LuDan;sallShow=true"  @mouseout="sallData.data='';sallShow=false" >{{sonTemi.GType|roomNuber}}{{sonTemi.TId}}</p>
                            <p class="right">
                                <span>{{sonTemi.RestHops}}s</span>
                                <span :class="{'dt':sonTemi.RestHops!=0}" ></span>
                            </p>
                        </li>						
                    </div>
                    <!-- 滚动条 -->
                    <div class="sollcp">
                        <a href="javascript:;" style="background: url(./static/img/bottomTable.png) no-repeat;background-size: 100% 100%" @mouseup="clearSet"  @mousedown="topRoom"></a>
                        <a href="javascript:;" style="background: url(./static/img/topTable.png) no-repeat;background-size: 100% 100%" @mouseup="clearSet" @mousedown="bottomRoom"></a>
                    </div>
                </div>
            </div>
            <!-- 互动房间列表 -->
                <div id="HdRoom" class="Room" :style="openShow" v-if="Room_attribute">
                        <!-- 打开列表 -->
                        <div class="open" @click="openHdRoom"></div>
                        <div class="RoomTop">
                            <p :class="ks==num?'in':''" v-for="(tiem,ks) in sonRoom" :key=ks v-if="sonRoom"  @click="tabRoomTable(ks)">{{ks}}</p>
                        </div>
                        <div class="center" >
                            <div class="table" id="table">
                                <li v-for="(sonTemi2,idx) in sonRoom[num]" :key=idx v-if="sonRoom[num]"  @click="TabRoom(sonTemi2.GType,sonTemi2.TId)">
                                    <p class="left" @mouseover="sallData.data=sonTemi2.LuDan;sallShow=true"  @mouseout="sallData.data='';sallShow=false" >{{sonTemi2.GType|roomNuber}}{{sonTemi2.TId}}</p>
                                    <p class="right">
                                        <span>{{sonTemi2.RestHops}}s</span>
                                        <span :class="{'dt':sonTemi2.RestHops!=0}" ></span>
                                    </p>
                                </li>						
                            </div>
                        </div>
                </div>
        </div>
        
        <!-- 下注成功动画 -->
        <transition enter-active-class="animated2 fadeInUp" >
            <div id="downPostSuccen" v-show="postSuccenAnimate">
                <p><span></span>下注成功{{postSuccenAnimate}}</p>
            </div>
        </transition>
        <!-- 未下注动画 -->
        <transition enter-active-class="animated2 fadeInUp"  leave-active-class="animated fadeOut">
            <div id="erroMoeny" v-show="noneMoney">
                <p >未下注</p>
            </div>
        </transition>
        <!-- 中奖效果 -->
        <transition enter-active-class="animated2 bounceIn"  >
            <div id="WinningPrize" v-show="Room.WinLose>0">
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <div class="jb"></div>
                <!-- 中间徽章 -->
                <div class="centerLogo">
                    <div class="winShowBox">
                        <span>赢了{{Room.WinLose}}</span>
                    </div>
                </div>
            </div>
        </transition>
        <!-- 输了效果 -->
        <transition enter-active-calss="animated2 bounceInDown" >
            <div id="loserPrize" v-show="Room.WinLose<0">
                <p>输了{{Room.WinLose*-1}}</p>
            </div>
        </transition>
    </div>	
</template>
<script>
import Luand from "@/components/Ludan.vue"
export default {
    name:"room",
    data(){return{
	  // 初始化数据
	  init:{
		Room:{
		  videoNotic:'',
		  personalDownMoney:0,
		  videoBox:{
			a:true,
			b:true,
		  }
		},
	  },
	 videoSetTime:{
		 a:null,
		 b:null
	 },
	  // 筹码设置列表参数
	  MoneyTableShow:false,
	  // 筹码列表
	  MoneyTable:[
				  {id:'5',to:false},
				  {id:'10',to:false},
				  {id:'20',to:false},
				  {id:'50',to:false},
				  {id:'100',to:false},
				  {id:'200',to:false},
				  {id:'500',to:false},
				  {id:'1000',to:false},
				  {id:'5000',to:false},
				  {id:'10000',to:false},
				  {id:'50000',to:false},
			],
	  // 下注筹码
	   cm:['5','10','20','50','100'],
	  //  预临时修改筹码列表
	   changeCm:['5','10','20','50','100'],
	  //  下注筹码
	   thisMoney:'',
	  //  下注表单
	   downMoney:[
					{downMoney:0,laodMoney:0},
					{downMoney:0,laodMoney:0},
					{downMoney:0,laodMoney:0},
					{downMoney:0,laodMoney:0},
					{downMoney:0,laodMoney:0},
					{downMoney:0,laodMoney:0},
					{downMoney:0,laodMoney:0},
					{downMoney:0,laodMoney:0},
				   ],
	  // 控制下注Class数据
	  postAnimated:false,
	  //   控制下注成功数据
	  postSuccenAnimate:0,
	  //控制未下注效果
	  noneMoney:false,
	  //打开游戏记录弹窗
	  getGmaeInitNum:false,
	  //打开会员信息弹窗
	  changeInitNum:false,
	  //控制全压效果数据
	  allClass:false,
	  // 桌位位置
	  posiNumber:2,
	  //倒计时定时器
	  TimeSet:null,
	  //公共房间列表
	  num:"迪威一厅",
	  //小路单wroket
	  samllWorker:{},
	  //小路单数据
	  sallData:{html:"",data:"",divWdith:0},
	  sallShow:false,
	  //公共房间列表倒计时
	  sonRoomSet:null,
	  lwzInput:null,
	  lwxInput:null,
	  //倒计时颜色
	  djsTextColor:"#fff",
	  //打开更换房间列表数据
	  openShow:'',
	  //上下拉动小房间列表定时器
	  samllSet:null,
	//   控制视频生命周期数据
	Videoshow:false
	}},
	computed:{
		publicWarehouse(){
			return this.$store.getters.publicWarehouse;
		},
		// 用户信息数据
		Init(){
			return this.$store.getters.Init;
		},
		// 公告数据
		Hall_Notice(){
			return this.$store.getters.Hall_Notice;
		},
		// 房间限红
		XH(){
			let a=parseInt(this.$route.params.Low)+"-"+parseInt(this.$route.params.Top);
			return a;
		},
		// 房间数据
		Room(){
			return this.$store.getters.Room;
		},
		Room_zxh(){
			let a=this.Room.ChipsSum;
			let b=a.split(",");
			let c=0;
			for(let i=0;i<b.length;i++){
				b[i]=b[i].split("/");
				b[i][0]=parseInt(b[i][0]);
				b[i][1]=parseInt(b[i][1]);
				b[i][0]?c+=parseInt(b[i][0]):false;
			}
			b.push(c);
			return b;
		},
		Room_zxhPropro(){
			let a=[];
			this.Room_zxh.forEach(array=>{
				let b="2%"
				if(array[0]>0){
					b= ((array[0]*1)/(this.Room_zxh[5]*1))*100+2+'%';
				}
				a.push(b);
			})
			return a;
		},
		// 计算开局庄赢庄对等数据
		gameNumRults(){
			let a=[0,0,0,0,0,0];
			let b=this.Room.LuDan;
			if(b!=''){
				for(let i=0;i<b.length;i++){			
					switch(b[i]){
						case "a":
							a[0]++;
						break;
						case "b":
							a[0]++;
							a[3]++;
						break;
						case "c":
							a[0]++;
							a[4]++;
						break;
						case "d":
							a[0]++;
							a[2]++;
							a[3]++;
						break;
						case "e":
							a[1]++;
						break;
						case "f":
							a[1]++;
							a[3]++;
						break;
						case "g":
							a[1]++;
							a[4]++;
						break;
						case "h":
							a[1]++
							a[3]++;
							a[4]++
						break;
						case "i":
							a[2]++;
						break;
						case "j":
							a[2]++
							a[3]++
						break;
						case "k":
							a[2]++
							a[4]++
						break;
						case "l":
							a[2]++
							a[4]++
							a[3]++
						break;
					}
				}
			}
			return a;
		},
		GTypeClass(){
			let a='';
			switch(this.Room.GType){
				case 1:
					a='desktop'
				break;
				case 2:
					a='Lhdesktop'
					break;
			}
			return a;
		},
		// 路单
		ludan(){
			let a={models:this.Room.GType ,data:this.Room.LuDan }
			return a;
		},
		// 公共房间列表数据
		sonRoom(){
			return this.$store.getters['RoomStore/tables'];
		},
		// 控制下注确定取消效果数据
		downLiClass(){
			var a=true;
			this.downMoney.forEach(array=>{
				if(array.laodMoney>0){
					a=false;
				}
				if(this.Room.RestHops<6){
					a=true;
				}
			})
			return a;
		},
		//桌面显示下注总额的数据
		allDownMoney(){
			let a=0;
			this.downMoney.forEach(array=>{
				a+=array.downMoney;
			})
			return a;
		},
		cardResult(){
			let a={z:false,x:false,h:false,zh:false,xh:false,titel:""};
			switch(this.Room.G_Result){
				case "300":
					a.titel = "和局";
					a.h=true;
                    break;
                case "310":
					a.titel = "和局庄对";
					a.h=true;
					a.zh=true;
                    break;
                case "311":
					a.titel= "和局庄闲对";
					a.h=true;
					a.xh=true;
					a.zh=true;
                    break;
                case "301":
					a.titel = "和局闲对";
					a.h=true;
					a.xh=true;
                    break;
				case "100":
					if(this.Room.GType==1){
						a.titel = "庄赢";
					}else if(this.Room.GType==2){
						a.titel = "龙赢";
					}
					a.z=true;
                    break;
				case "110":
					if(this.Room.GType==1){
						a.titel = "庄赢庄对";
					}else if(this.Room.GType==2){
						a.titel = "龙赢龙对";
					}
					a.z=true;
					a.zh=true;
                    break;
				case "111":
					if(this.Room.GType==1){
						a.titel = "庄赢庄闲对";
					}else if(this.Room.GType==2){
						a.titel = "龙赢龙虎对";
					}
					a.z=true;
					a.xh=true;
					a.zh=true;
                    break;
				case "101":
					if(this.Room.GType==1){
						a.titel = "庄赢闲对";
					}else if(this.Room.GType){
						a.titel = "龙赢虎对";
					}
					a.z=true;
					a.xh=true;
                    break;
				case "200":
					if(this.Room.GType==1){
						a.titel = "闲赢";
					}else if(this.Room.GType==2){
						a.titel = "虎赢";
					}
					a.x=true;
                    break;
				case "210":
					if(this.Room.GType==1){
						a.titel = "闲赢庄对";
					}else if(this.Room.GType==2){
						a.titel="虎赢龙对"
					}
					a.x=true;
					a.zh=true;
                    break;
				case "211":
					if(this.Room.GType==1){
						a.titel = "闲赢庄闲对";
					}else if(this.Room.GType==2){
						a.titel = "虎赢龙虎对";
					}
					a.x=true;
					a.zh=true;
					a.xh=true;
                    break;
				case "201":
					if(this.Room.GType==1){
						a.titel = "闲赢闲对";
					}else if(this.Room.GType==2){
						a.titel = "虎赢虎对";
					}
					a.x=true;
					a.xh=true;
					break;
			}
			return a;
		},
		// 开牌结果显示
		cards(){
			let a={x:0,z:0,xp:[],zp:[]};
			let b=[];
			if(this.Room.PaiMian){
				let c=this.Room.PaiMian.split(",");
				c.forEach(array=>{
					if(array<20000){
						array=array%10000;
						a.zp.push(array);
					}else{
						array=array%10000;
						a.xp.push(array);
					}
					array=(array%1000)/10;
					if(this.Room.GType==1){
						array=array>10?0:array;
					}
					b.push(array);
				})

				if(this.Room.GType==1){
					a.z=(b[0]+b[1]+b[2])%10;
					a.x=(b[3]+b[4]+b[5])%10;				
				}
				else if(this.Room.GType==2){
					a.z=b[0];
					a.x=b[1];
				}

				if(this.Room.GType==1){
					window.AudioObj.Play(["z"+a.z,"x"+a.x,"bjl"+this.Room.G_Result])
				}
				else if(this.Room.GType==2){
					window.AudioObj.Play(["l"+a.z,"h"+a.x,"lh"+this.Room.G_Result])
				}			
			}
			return a;
		},
		// 停止下注
		downNot(){
			if(this.Room.RestHops<6){
				return true;
			}
			else if(this.Room.RestHops<11){
				this.djsTextColor="red";
				return false;
			}
			else{
				return false;
			}
		},
		// 是否为互动百家乐
		Room_attribute(){
			let a;
			if(this.Room.Room_attribute===2){
				a=true;
			}else{
				a=false;
			}
			return a;
		},
		videoStatus(){
			return this.$store.getters.videoStatus;
		}
	},
	watch:{
		"publicWarehouse.RoomBetInfo"(newVal,oldVal){
			if(newVal!=oldVal&&oldVal===false){
				if(newVal){
					let a=newVal.BetInfo;
					let b=newVal.BetHistory;
					a=a.split(",")
					b=b.split(",")
					a.forEach(array=>{
						this.postSuccenAnimate+=parseInt(array);
						this.postAnimated=true;
					})
					switch(this.Room.GType){
						case 1:
							for(let i=0;i<5;i++){
								this.downMoney[i].downMoney=parseInt(b[i]);
							}
						break;
						case 2:
							for(let i=0;i<3;i++){
								this.downMoney[i+5].downMoney=parseInt(b[i]);
							}
						break;
					}
					this.$store.commit("ClearPublicWarehouse","RoomBetInfo");
					this.downMoney.forEach(array=>{
							array.laodMoney=0;
					})
					setTimeout(()=>{
						this.postSuccenAnimate=0;
					},1500)					
				}
			}
		},
		"publicWarehouse.RoomLoserBet":function(newVal,oldVal){
			if(newVal!=oldVal&&oldVal===false){
				this.downMoney.forEach(array=>{
						array.laodMoney=0;
				})
				this.$store.commit("ClearPublicWarehouse","RoomLoserBet");
			}
		},
		"Room.BetHistory":function(val,old){
			if(val!=old){
				let b=val.split(",");
				switch(this.Room.GType){
					case 1:
						for(let i=0;i<5;i++){
							this.downMoney[i].downMoney!=parseInt(b[i])?this.downMoney[i].downMoney=parseInt(b[i]):false;
						}
					break;
					case 2:
						for(let i=0;i<3;i++){
							this.downMoney[i+5].downMoney!=parseInt(b[i])?this.downMoney[i+5].downMoney=parseInt(b[i]):false;
						}
					break;
				}
			}
		},
		//监控时间变化进行倒计时
		"Room.RestHops":function(newVal,oldVal){
			if(newVal!=oldVal){
				if(oldVal==0){
					this.StarTimeVal();
					window.AudioObj.Play(["startbet"])
				}
				else if(newVal==0){	
					this.$store.commit("BetTimeOut");
					this.init.Room.videoNotic="结算中";
				}
				else if(newVal==5){
					let num;
					let b=this.Room.BetHistory;
					b=b.split(',');
					b.forEach(nb=>{
						if(parseInt(nb)>0){
							num+nb;
						}
					})
					// num>0?this.noneMoney=true:false;
					if(num>0){
						this.noneMoney=true;
						setTimeout(()=>{
							this.noneMoney=false;
						},1500)						
					}

				}	
			}
		},
		// 检查房间状态
		"Room.CurrState":function(newVal,oldVal){
			if(newVal!=oldVal){
				switch(newVal){
					case 1:
						this.init.Room.videoNotic="派彩中";
					break;
					case 2:
						this.djsTextColor="#fff";
						this.init.Room.videoNotic="";
						this.downMoney=[{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},]
					break;
					case 3:
						this.init.Room.videoNotic="洗牌中";
					break;
					case 4:
						this.init.Room.videoNotic="结算中";
					break;
					case 5:
						this.init.Room.videoNotic="开奖结束";
					break;
					case 6:
						this.init.Room.videoNotic="重新扫牌";
					break;
					case 7:
						this.init.Room.videoNotic="本局作废";
						this.downMoney=[{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},{downMoney:0,laodMoney:0},]
					break;
				}
			}
		},
		// 小路单变化
		"sallData.data":function(newVal,oldVal){
			if(newVal!=oldVal){
				if(newVal){
					this.samllWorker.postMessage({data:newVal,model:this.Init.GT});
				}else{
					this.sallData.html="";
				}
			}
		},
	},
	components:{
		Luand,
		changeInit,
		getGameLog,
		chat
	  },
	directives:{
		logo:{
			bind(el){
				var canvas=el.getContext("2d");
				var img=new Image();
				img.src="";
				img.onload=function(){
					canvas.drawImage(img,-90,0);
					var xx=0;
					setInterval(function(){
					if(xx>90){
						xx=-90
					}else{
					xx++;  
					}
					canvas.clearRect(0,0,140,140);
					canvas.drawImage(img,xx,0);
					},10)
				}
			}
		},
		// H5视频启动指令
		// roomVideo:{
		// 	bind(el,bind){
		// 		var obj=bind.value;
		// 		if(obj.id==1){
		// 			obj.c(new AMT.Player('ws://125.90.93.106:8084/', { canvas: el, autoplay: true, vlab: obj.src },obj.login));
		// 		}else if(obj.id==2){
		// 			obj.c(new AMT.Player('ws://125.90.93.106:8084/', { canvas: el, autoplay: true, vlab: obj.src },obj.login));
		// 		}
		// 	}
		// },
		// falsh视频播放
		starFalsh:{
			bind(el,val){
				let set=val.value.set;
				let index=val.value.index;
				set(el,index);
			}
		},
		// 小路单指令
		"samll-Ludan":{
			update(el,bind){
				if(bind.value!=bind.oldValue){
					// 获取子节点数组
					var chil=el.childNodes;
					if(chil.length<=1){
						return false;
					}
					// 获取最后一位的位移
					var leftPosi=parseInt(chil[chil.length-1].style.left);
					// 获取最长长度
					var left=bind.value;
					var width=parseInt(chil[1].style.width);
					// 计算自动偏移的像素单位位置
					var leftWidth=((leftPosi+width-99)*-0.01)*parseInt(el.clientWidth);
					// 设置屏障长度大于盘珠
					chil[0].style.width=Math.ceil((left+width)*0.01)*100+"%";
					// 是否超出100宽度
					if(left>95){
						// 设置显示框移动到
						el.style.left=leftWidth+"px";
					}else{
						//小于100%超度，恢复位移为0
						el.style.left="0px";
					}
				}
			}
		}
	},
	methods:{
		// 保存falsh对象
		setFalsh(el,index){
			this.init.Room.videoBox[index]=el;
			this.playFalsh(index);
		},
		playFalsh(index){
			let el=this.init.Room.videoBox[index];
			clearInterval(this.videoSetTime[index]);
			this.videoSetTime[index]=setInterval(()=>{
				if(el.jsInit){
						let newindex=index=='a'?0:1;
						let el =this.init.Room.videoBox[index];
						let url=this.Room.VideoUrl[newindex];
						url=url.split("^^");
						el.jsInit(null,"liveInit",'a'+newindex);
						this.postVideoStar(el,url,newindex);
						clearInterval(this.videoSetTime[index])
				}
			},800)
		},
		// 重新加载视频事件
		allVideoRestar(){
			this.init.Room.videoBox.b.refresh()
			this.init.Room.videoBox.a.refresh();
		},
		// 视频2换台
		tabVideoTo(x){
			// H5
		//   this.init.Room.videoBox.b=true;
		//   this.init.Room.Player2.source.send(x);
		// FAHSL
			this.$store.dispatch("setVideoStatus",{data:true,index:1});
			let el =this.init.Room.videoBox.b;
			let url
			switch(x){
				case 0:
					url=this.Init.UserCentent.Video;
					url=url.split("^^");
				break;
				case 1:
					url=this.Room.VideoUrl[0];
					url=url.split("^^");
				break;
				case 2:
					url=this.Room.VideoUrl[1];
					url=url.split("^^");
				break;
			}
			this.postVideoStar(el,url,1);
		},
		// 链接视频播放
		postVideoStar(els,arrays,index){
			let el=els;
			let array=arrays;
			window.videoSet[index]?clearInterval(window.videoSet[index]):false;
			window.videoSet[index]=null;
			el.playLive(array[0],array[1]);
			window.videoSet[index]=setInterval(()=>{
				el.playLive(array[0],array[1]);
			},10000)
		},
		// 显示视频中断加载函数
		// 	videoLoginA(){
		// 		if(this.init.Room.videoBox.a){
		// 			this.init.Room.videoBox.a=false;
		// 		}
		// 		return false;
		// 	},
		// 	videoLoginB(){
		// 		if(this.init.Room.videoBox.b){
		// 			this.init.Room.videoBox.b=false;
		// 		}
		// 		return false;
		// 	},
		// // 存储视频对象函数
		// 	vidoeObj1(x){
		// 		this.init.Room.Player1=x;
		// 	},
		// 	vidoeObj2(x){
		// 		this.init.Room.Player2=x;
		// 	},
		// 全屏
		F11(){
				var el=document.documentElement;
				var isFullscreen=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;
				if(!isFullscreen){//进入全屏,多重短路表达式
				(el.requestFullscreen&&el.requestFullscreen())||
				(el.mozRequestFullScreen&&el.mozRequestFullScreen())||
				(el.webkitRequestFullscreen&&el.webkitRequestFullscreen())||(el.msRequestFullscreen&&el.msRequestFullscreen());
				var height=window.screen.height;
				  this.height=height-70+'px';
				}else{	//退出全屏,三目运算符
				document.exitFullscreen?document.exitFullscreen():
				document.mozCancelFullScreen?document.mozCancelFullScreen():
				document.webkitExitFullscreen?document.webkitExitFullscreen():'';
				document.msExitFullscreen?document.msExitFullscreen():'';
				var height=document.documentElement.scrollHeight;
				}
		},
		isMoney(x){
				 this.MoneyTable.forEach(array=>{
					switch(array.id){
					case x[0]:
					array.to=true;
					break;
					case x[1]:
					array.to=true;
					break;
					case x[2]:
					array.to=true;
					break;
					case x[3]:
					array.to=true;
					break;
					case x[4]:
					array.to=true;
					break;
					default:
					array.to=false;
					}
			})
		},
		echoNull(x){
		  var b=JSON.parse(JSON.stringify(x))
		  return b;
		},
		pushMoney(x){
		let a=true;
		  for(let i=0;i<this.changeCm.length;i++){
			  if(this.changeCm[i]==x){
				this.changeCm.splice(i,1);
				a=false;
			  }
		  }
		  if(a&&this.changeCm.length==5){
			this.changeCm.shift();
			this.changeCm.push(x);
			this.isMoney(this.changeCm);			  
		  }
		  else if(a){
			this.changeCm.push(x);
			this.isMoney(this.changeCm);
		  }
		  else{
			this.isMoney(this.changeCm);
		  }
		},
		// 提交筹码设置
		postMoney(){
		  let a=this.echoNull(this.changeCm);
		  if(a.length!=5){
			  this.$store.commit("changeTips",{data:"请选择5个筹码"});
			  return false;
		  }
		  //进行筹码排序
		  for(let i=0;i<a.length;i++){
				for(let o=i+1;o<a.length;o++){
					if(a[i]*1>a[o]*1){
						let sum=a[i];
						a[i]=a[o]
						a[o]=sum;
					}
				}
		  }
		  this.cm=a;
		  a=JSON.stringify(a)//转换成JSON字符串
		  localStorage.setItem("CM",a);
		  a=null;
		  this.isMoney(this.cm);
		  this.MoneyTableShow=false;
		},
		// 取消改变筹码设置
		backMoney(){
		  var a=this.echoNull(this.cm);
		  this.changeCm=a;
		  a=null;
		  this.isMoney(this.cm);
		  this.MoneyTableShow=false;
		},
		// 改变下注筹码
		changeThisMoney(x){
		  window.AudioObj.Play(['tab'])//播放切换筹码声音
		  this.thisMoney=x;
		  this.allClass=false;
		},
		// 下注前限红判断
		judgeMoney(index,money){
			let a=false;
			switch(index){
				case 0:
					if(money>this.$route.params.Top){
						a=true;
					}
				break;
				case 1:
					if(money>this.$route.params.Top){
						a=true;
					}
				break;
				case 2:
					if(money>this.$route.params.Top/8){
						a=true;
					}
				break;
				case 3:
					if(money>this.$route.params.Top/11){
						a=true;
					}
				break;
				case 4:
					if(money>this.$route.params.Top/11){
						a=true;
					}
				break;				
			}
			return a;
		},
		// 线框下注
		StarMoney(x){
		  this.postAnimated=false;
		  if(this.Init.UserCentent.Balance<=0||this.Init.UserCentent.Balance<this.thisMoney){
			this.$store.commit("changeTips",{data:'筹码不足够啦，请充值'})
		  }else if(this.thisMoney==0||this.thisMoney==null){
			this.$store.commit("changeTips",{data:'请选择下注筹码'})
		  }else if(this.judgeMoney(x,this.downMoney[x].laodMoney+this.thisMoney*1)){
			this.$store.commit("changeTips",{data:"超过个人限红，无法下注"})
		  }else if(this.downMoney[x].laodMoney+this.thisMoney*1<this.$route.params.Low){
			this.$store.commit("changeTips",{data:"低于限红，请重新选择下注筹码"})
		  }else{
			this.downMoney[x].laodMoney+=this.thisMoney*1;
			this.$store.commit("reduceMoney",this.thisMoney*-1);
		  }
		},
		// 取消下注
		notMoney(){
		  var money=0;
		//   清除
		  this.downMoney.forEach(array=>{
			  money+=array.laodMoney*1;
			  array.laodMoney=0;
		  })
		  // 恢复余额
		  this.$store.commit("reduceMoney",money*1);
		},
		// 下注全压
		allMoney(event){
			let allNumber=this.echoNull(this.Init.UserCentent.Balance);
			let topMoney=parseInt(this.$route.params.Top);
		  // 取消全压
		  if(this.thisMoney==allNumber||this.thisMoney==topMoney){
			this.thisMoney=this.cm[0];
			this.allClass=false;
		  }else{//选择全压
			if(allNumber>topMoney){
				this.thisMoney=topMoney;
			}
			else{
				this.thisMoney=allNumber;
			}
			this.allClass=true;
		  }
		},
		// 确定提交下注
		postMoneyFrom(){
			let BetInfo="";
			let nowDate=Math.round(new Date().getTime()/1000);
			switch(this.Room.GType){
				case 1://百家乐
					BetInfo=this.downMoney[0].laodMoney+","+this.downMoney[1].laodMoney+","+this.downMoney[2].laodMoney+","+this.downMoney[3].laodMoney+","+this.downMoney[4].laodMoney;
					window.userSocket.uSend('{"ActType":2,"ErrorCode":10000,"Content":{"BetInfo":"'+BetInfo+'","UId":"' + UserId + '","IsAllIn":false,"CurrJu":'+this.Room.CurrJu+',"CurrXue":'+this.Room.CurrXue+',"TimeStamp":'+nowDate+'},"UId":"' + UserId + '","ConnectionId":"","GTableId":'+this.Room.TId+',"GT":'+this.Room.GType+',"RandCode":"' + RandCode + '"}');
				break;
				case 2://龙虎
					BetInfo=this.downMoney[5].laodMoney+","+this.downMoney[6].laodMoney+","+this.downMoney[7].laodMoney;
					window.userSocket.uSend('{"ActType":2,"ErrorCode":10000,"Content":{"BetInfo":"'+BetInfo+'","UId":"' + UserId + '","IsAllIn":false,"CurrJu":'+this.Room.CurrJu+',"CurrXue":'+this.Room.CurrXue+',"TimeStamp":'+nowDate+'},"UId":"' + UserId + '","ConnectionId":"","GTableId":'+this.Room.TId+',"GT":'+this.Room.GType+',"RandCode":"' + RandCode + '"}');
				break;
			}
			window.AudioObj.Play(['down'])
		},
		// 切换房间列表
		tabRoomTable(x){
		  this.num=x;
		},
		// 上下拉换房间列表
		bottomRoom(){
		clearInterval(this.samllSet);
		  var a=document.getElementById("table");
		  var b=a.scrollHeight-a.clientHeight;
		  this.samllSet=setInterval(()=>{
			a.scrollTop+=2;
			if(a.scrollTop>=b){
			  clearInterval(this.samllSet);
			}
		  })
		},
		// 切换小房间列表
		topRoom(){
		  clearInterval(this.samllSet);
		  var a=document.getElementById("table");
		  this.samllSet=setInterval(()=>{
			a.scrollTop-=2;
			if(a.scrollTop<=0){
			  clearInterval(this.samllSet)
			}
		  })
		},
		// 拉动列表浏览暂时清楚定时器
		clearSet(){
		  clearInterval(this.samllSet);
		},
		// 打开关闭会员设置
		getInitNum(){
			if(this.changeInitNum){
				this.changeInitNum=false;
			}else{
				this.changeInitNum=true;
				this.$store.dispatch("User/getUser");
			}
		},
		// 打开关闭游戏记录查询
		getGmaeInit(){
			if(this.getGmaeInitNum){
				this.getGmaeInitNum=false;
			}else{
				this.getGmaeInitNum=true;
				this.$store.dispatch("log/getGameLog",{});
			}
		},
		// 返回大厅
		RetrunHall(){
			let HallNumber=this.Room.HallNumber;
			console.log(HallNumber);
			let GType=this.Room.GType
			window.userSocket.uSend('{"ActType":3,"ConnectionId":"","Content":{"HallNumber": '+HallNumber+'},"ErrorCode":10000,"RandCode":"' + RandCode + '","UId":"' + UserId + '","GT": '+ GType+' }');
			let oldListName=this.$store.getters.ListStatusName;
			let i;
			for(i in oldListName){
				window.ioSocket.emit('unsubscribe',oldListName[i]);
			}
			this.$store.commit("clearRadisnName")
			window.ioSocket.emit('subscribe','RoomListInRoom'+HallNumber+GType);
			if(HallNumber==1){
				for(let j = 32; j >= 1; j--){
					window.ioSocket.emit('subscribe',"RoomBroadCastAfterTZ"+j);
				}
			}else if(HallNumber==2){
				for(let j = 61; j >= 33; j--){
					window.ioSocket.emit('subscribe',"RoomBroadCastAfterTZ"+j);
				}
			}
			this.$store.commit("InitRoom");
			this.$router.replace({name:"home",params:{m:HallNumber}})
		},
		// 路问路单
		tabPostLudan(x){
			this.$refs.luandSon.tabLudan(x);
		},
		// 启动当局定时器
		StarTimeVal(){
			this.TimeSet?clearInterval(this.TimeSet):false;
			this.init.Room.videoNotic="";
			this.TimeSet=setInterval(()=>{
				this.$store.commit("reduceRoomTime");
				if(this.Room.RestHops<=0){
					clearInterval(this.TimeSet);
				}
			},1000)	
		},
		// 切换到其他房间
		TabRoom(GType,TId){
			this.beforVideo();
			// 初始化数据
			this.sallShow=false;
			this.thisMoney=null;
			this.downMoney=[
				{downMoney:0,laodMoney:0},
				{downMoney:0,laodMoney:0},
				{downMoney:0,laodMoney:0},
				{downMoney:0,laodMoney:0},
				{downMoney:0,laodMoney:0},
				{downMoney:0,laodMoney:0},
				{downMoney:0,laodMoney:0},
				{downMoney:0,laodMoney:0},
			   ],
			// 控制下注Class数据
			this.postAnimated=false;
			//   控制下注成功数据
			this.postSuccenAnimate=0;
			//控制未下注效果
			this.noneMoney=false;
			//打开游戏记录弹窗
			this.getGmaeInitNum=false;
			//打开会员信息弹窗
			this.changeInitNum=false;
			//控制全压效果数据
			this.allClass=false;
			// 桌位位置
			this.posiNumber=2;
			// //倒计时定时器
			// clearInterval(this.TimeSet);
			// this.TimeSet=null,
			//公共房间列表
			this.num="迪威一厅";
			this.sallShow=false;
			this.lwzInput=null;
			this.lwxInput=null;
			//倒计时颜色
			this.djsTextColor="#fff";
			//打开更换房间列表数据
			this.openShow='';
			let oldRoom = this.Room.TId;
			window.userSocket.uSend('{"ActType":5,"ConnectionId":"","GTableId":'+TId+',"ErrorCode":10000,"UId":"' + UserId + '","RandCode":"' + RandCode + '","GT":'+GType+'}')
			window.ioSocket.emit('unsubscribe',"RoomBroadCastAfterTZ"+oldRoom);
			window.ioSocket.emit('subscribe',"RoomBroadCastAfterTZ"+TId);
		},
		// 设置音量
		setAudio(event){
			let a=event.target.value;
			event.target.style="background-size:"+a+"% 100%"
			window.AudioObj.setVolume(a);
		},
		setLwz(html){
			this.lwzInput!=html?this.lwzInput=html:false;
		},
		setLwx(html){
			this.lwxInput!=html?this.lwxInput=html:false;
		},
		openHdRoom(){
			if(this.openShow==''){
				this.openShow="right:0px"
			}else{
				this.openShow=""
			}
		},
		postMessage(x){
			let msg=x;
			msg.room="BIG",
			this.samllWorker.postMessage(msg);
		},
		beforVideo(){
			this.Videoshow=false;
			setTimeout(()=>{
				this.Videoshow=true;
			},500)
		}
	},
	mounted(){
		let CM=localStorage.getItem('CM');
		if(CM){
			CM=JSON.parse(CM)
			this.cm=CM;
			this.isMoney(CM);//设置列表发光筹码
		}else{
			this.isMoney(this.cm)
		}
		// 随机桌位位置
		this.posiNumber=Math.ceil(Math.random()*7);
		if(window.userSocket){
			this.$store.dispatch("RoomStore/getPublicTable").then(
				()=>{
					this.sonRoomSet=setInterval(()=>{
						for(let i in this.sonRoom){
							for(let u=0;u<this.sonRoom[i].length;u++){
								if(this.sonRoom[i][u].RestHops!=0){
									this.$store.commit("RoomStore/reduce",{id:i,index:u});
								}
							}
						}
					},1000)
				}
			)
		}
		this.samllWorker=new Worker("./static/js/ludan.js");
		this.samllWorker.onmessage=(el)=>{
			let msg=el.data;
			if(msg.room=="BIG"){
				this.$refs.luandSon.setLudan(msg);
			}else{
				if(el.data.id==2)
				this.sallData.html=el.data.html;
				this.sallData.divWdith=el.data.divWdith;
			}
		}
		this.beforVideo();
	},
	beforeDestroy(){
		clearInterval(this.videoSetTime[0])
		clearInterval(this.videoSetTime[1])
		clearInterval(window.videoSet[0])
		clearInterval(window.videoSet[1])
		clearInterval(this.TimeSet);
		clearInterval(this.sonRoomSet);
		this.TimeSet=null;
		this.samllWorker.terminate();
	}
}
</script>
